package com.cj.ServiceImpl;

import com.cj.Service.EmpService;
import com.cj.dao.EmployeeDao;
import com.cj.pojo.EmployeePojo;
import com.cj.vo.EmpPageVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EmpServiceImpl implements EmpService {

    @Autowired
    EmployeeDao employeeDao;

    @Override
    public List<EmployeePojo> queryEmpPage(EmpPageVo empPageVo) {
//        List<EmployeePojo> lists =employeeDao.queryAllEmp(empPageVo);
//        for (EmployeePojo poji:lists) {
//            System.out.println(poji);
//        }
        return employeeDao.queryAllEmp(empPageVo);
    }

    @Override
    public Integer countEmp(EmployeePojo employeePojo) {
        return employeeDao.countEmp(employeePojo);
    }

    @Override
    public void addEmployee(EmployeePojo employeePojo) {
        employeeDao.addEmployee(employeePojo);
    }

    //
    @Override
    public void deleteEmp(Integer... ids) {
//        System.out.println(ids);
        employeeDao.deleteEmp(ids);
    }

    @Override
    public void updataEmp(EmployeePojo employeePojo) {
        employeeDao.updateEmp(employeePojo);
    }
}
